/**
 * 可写流，写入字符串或者buffer
 * 可写流调用end方法结束写操作
 * end结束后，不能再次写入
 */

const fs = require('fs')

const ws = fs.createWriteStream('./res/write.txt')

const buffer = Buffer.from('123')
ws.write(buffer)

ws.on('open', () => {
    console.log('开始写')
})

ws.end()

ws.on('finish', () => {
    console.log('写完')
})

